__author__ = 'alan'
import numpy as np

S = np.matrix([[0.1, 0.2 ,0.7]])
P = np.matrix([[0.5 ,0.3, 0.2],
               [0.3, 0.6, 0.1],
               [0.1 ,0.5 ,0.4]])

#马尔科夫收敛
for i in range(1,30):
    S = S*P
    print("第{}天的概率：{}".format(i,S))
